# -*- coding: utf-8 -*-
# @Time    : 2021/4/14 9:44
# @Author  : Chen
# @Email   : 2356458272@qq.com
# @File    : 文件操作.py
# @Software: PyCharm

# b = {}
# c = []
# d = {}
# for i in open("test.txt"):
#     a = i[11:]
#     if a in b:
#         b[a] = b[a]+1
#     else:
#         b[a] = 1
# b = list(b.items())
# b.sort(key=lambda x: x[1], reverse=True)
# print(b)
# for i in b[:10]:
#     print("ip:172.25.254."+i[0],"频率为：",i[1])


# with open("guest.txt","a+",encoding="utf-8") as f:
#     a = input("请输入用户名：")
#     f.write(a)

# import random
# a = {0:'A',1:'B',2:'C',3:'D',4:'E',5:'F'}
# with open("guest.txt","a+") as f:
#     for i in range(100):
#         b = random.randint(0,5)
#         c = random.randint(0, 5)
#         d = random.randint(0, 5)
#         e = random.randint(0,9)
#         g = random.randint(10,99)
#         f.write("01-AF-3B"+ "-"+a[b]+a[c]+"-"+a[d]+str(e)+"-"+str(g)+"\n")

# import random
# a = {0:'A',1:'B',2:'C',3:'D',4:'E',5:'F'}
# with open("guest.txt","a+") as f:
#     for i in range(100):
#         b = random.randint(0,5)
#         c = random.randint(0, 5)
#         d = random.randint(0, 5)
#         e = random.randint(0,9)
#         g = random.randint(10,99)
#         f.write("01-AF-3B"+ "-"+a[b]+a[c]+"-"+a[d]+str(e)+"-"+str(g)+"\n")


# a = {}
# str=""
# with open("Walden.txt","r",encoding="utf-8") as f:
#     for i in f:
#         for j in i.upper():
#             if j.isalpha():
#                 str += j
#             else:
#                 if str not in a:
#                     a[str] = 1
#                     str = ""
#                 else:
#                     a[str] += 1
#                     str = ""
# a.pop('')
# print(a)